<template>
  <view
    class="load-module-wrap"
    @tap="skipToLoadPage"
  >
    <view
      class="d-flex flex-column j-sb"
      style="width: 618upx;height: 226upx;background-color: #FFFFFF;padding: 0 36upx;"
    >
      <view
        class="d-flex a-center j-sb"
        style="height: 167upx;"
      >
        <view>
          <text
            class="font-30"
            style="font-weight: bold;"
          >{{ title }}</text>
        </view>
        <image
          :src="imgUrl"
          style="width: 105upx;height: 121upx;margin-right: 10upx;"
          mode=""
        ></image>
      </view>
      <view
        class="d-flex a-center "
        style="height: 58upx; border-top: 1px solid #eee;"
      >
        <text
          class="font-22"
          style="color: #CCCCCC;"
        >最近更新: {{ updateDate }}</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: '中国房地产报PDF下载'
    },
    updateDate: {
      type: String,
      default: '2019-12-05 15:12:23'
    },
    imgUrl: {
      type: String,
      default: '/static/test/loadImg.png'
    }
  },
  methods: {
    skipToLoadPage() {
      let token = uni.getStorageSync('token');
      if (token) {
        uni.navigateTo({
          url: '/pages/loadPdf/loadPdf'
        })
      } else {
        uni.navigateTo({
          url: '/pages/mine/login/login'
        })
      }
    }
  }
};
</script>

<style>
.load-module-wrap {
  height: 226upx;
  background-color: #f3f3f3;
  padding: 24upx 30upx;
}
</style>
